package lego.jbv;

import lego.jbv.CarCommand.Command;

class Cruise extends Thread implements ICommand
{	
	private boolean stop;
	private CarCommand.Command command;
	private boolean hasCommand;
	
    public Cruise()
    {
    	this.setDaemon(true);
    	hasCommand = false;
    }
    
	public void run() 
	{
		hasCommand = true;
		while(!stop)
		{
			command = Command.FORWARD;
		}
    }
	
	public void stop()
	{
		stop = true;
		hasCommand = false;
	}

	@Override
	public CarCommand.Command getCommand() {
		return command;
	}

	@Override
	public boolean hasCommand() {
		return hasCommand;
	}
}


